<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Easy
  </div>
  <div>
   <h1 class="question_title">
    344. Reverse String
   </h1>
   <p>
    Write a function that reverses a string. The input string is given as an array of characters
    <code>
     char[]
    </code>
    .
   </p>
   <p>
    Do not allocate extra space for another array, you must do this by
    <strong>
     modifying the input array&nbsp;
     <a href="https://en.wikipedia.org/wiki/In-place_algorithm" target="_blank">
      in-place
     </a>
    </strong>
    with O(1) extra memory.
   </p>
   <p>
    You may assume all the characters consist of
    <a href="https://en.wikipedia.org/wiki/ASCII#Printable_characters" target="_blank">
     printable ascii characters
    </a>
    .
   </p>
   <p>
    &nbsp;
   </p>
   <div>
    <p>
     <strong>
      Example 1:
     </strong>
    </p>
    <pre>
<strong>Input: </strong><span id="example-input-1-1">["h","e","l","l","o"]</span>
<strong>Output: </strong><span id="example-output-1">["o","l","l","e","h"]</span>
</pre>
    <div>
     <p>
      <strong>
       Example 2:
      </strong>
     </p>
     <pre>
<strong>Input: </strong><span id="example-input-2-1">["H","a","n","n","a","h"]</span>
<strong>Output: </strong><span id="example-output-2">["h","a","n","n","a","H"]</span>
</pre>
    </div>
   </div>
  </div>
  <div>
   <h1 class="question_title">
    344. 反转字符串
   </h1>
   <p>
    编写一个函数，其作用是将输入的字符串反转过来。输入字符串以字符数组
    <code>
     char[]
    </code>
    的形式给出。
   </p>
   <p>
    不要给另外的数组分配额外的空间，你必须
    <strong>
     <a href="https://baike.baidu.com/item/原地算法" target="_blank">
      原地
     </a>
     修改输入数组
    </strong>
    、使用 O(1) 的额外空间解决这一问题。
   </p>
   <p>
    你可以假设数组中的所有字符都是
    <a href="https://baike.baidu.com/item/ASCII" target="_blank">
     ASCII
    </a>
    码表中的可打印字符。
   </p>
   <p>
    &nbsp;
   </p>
   <p>
    <strong>
     示例 1：
    </strong>
   </p>
   <pre><strong>输入：</strong>["h","e","l","l","o"]
<strong>输出：</strong>["o","l","l","e","h"]
</pre>
   <p>
    <strong>
     示例 2：
    </strong>
   </p>
   <pre><strong>输入：</strong>["H","a","n","n","a","h"]
<strong>输出：</strong>["h","a","n","n","a","H"]</pre>
  </div>
 </body>
</html>